package com.marry.api;

import com.marry.entity.Album;
import com.marry.model.Result;
import com.marry.repository.AlbumRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 接口
 */
@RestController
@RequestMapping("/api/album")
public class AlbumApi {

    @Autowired
    private AlbumRepository albumRepository;

    /**
     * 获取
     */
    @PostMapping("/list")
    public Result list() {
        List<Album> list = albumRepository.findAll();
        return Result.ok(list);
    }
}
